

#include "CProduction_Expression.h"

#include "../NativeGrammar.h"


CTokenPtr CProduction_Expression_Copy::Reduce( CProductionArgPtr pArgs )
{
    return pArgs->getArg<CExpression>(0);
}

CTokenPtr CProduction_Expression_Assign::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Assign::create(
		pArgs->getArg<CVariable>(0), pArgs->getArg<CExpression>(2));
}



CTokenPtr CProduction_Expression_Plus::Reduce( CProductionArgPtr pArgs )
{
    return CExpression_Plus::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}


CTokenPtr CProduction_Expression_Minus::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Minus::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}

CTokenPtr CProduction_Expression_Mult::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Mult::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}

CTokenPtr CProduction_Expression_Divide::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Divide::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}

CTokenPtr CProduction_Expression_Nagetive::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Nagetive::create(
		pArgs->getArg<CExpression>(1));
}

CTokenPtr CProduction_Expression_ParentThese::Reduce( CProductionArgPtr pArgs )
{
    return pArgs->getArg<CExpression>(1);
}

CTokenPtr CProduction_Expression_Equal::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Equal::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}

CTokenPtr CProduction_Expression_NotEqual::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_NotEqual::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}

CTokenPtr CProduction_Expression_Mod::Reduce( CProductionArgPtr pArgs )
{
	return CExpression_Mod::create(
		pArgs->getArg<CExpression>(0), pArgs->getArg<CExpression>(2));
}